import { authToken } from '@/utils/auth'

const state = {
    token: null,
    permissions: ['user']
}

const mutations = {
    SET_TOKEN (state, data) {
        authToken.setToken(data)
        state.token = data
    }
}

const actions = {
    setToken ({ commit }, data) {
        commit('SET_TOKEN', data)
    }
}

export default {
    state,
    mutations,
    actions
}
